import TextArea from "antd/es/input/TextArea"
import { FC } from "react"

import { SFormItem } from "@/components/common"
import { useLocale } from "@/locales"

const ReMarkInput: FC<any> = props => {
	const { formatMessage } = useLocale()
	const { required, placeholder, label, maxlength } = props
	return (
		<SFormItem
			label={formatMessage({ id: label ? label : "label.remarks" })}
			name={"remark"}
			required={required}
			rules={[
				{
					message: formatMessage({
						id: "common.components.please_input_remark",
						values: { sth: formatMessage({ id: "nouns.merchant" }) }
					})
				}
			]}
		>
			<TextArea
				placeholder={formatMessage({ id: placeholder })}
				maxLength={maxlength}
				count={{
					show: true,
					max: 50
				}}
			/>
		</SFormItem>
	)
}

export default ReMarkInput
